package com.bjsxt.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bjsxt.domain.UserFavoriteMarket;
import com.bjsxt.mapper.UserFavoriteMarketMapper;
import com.bjsxt.service.UserFavoriteMarketService;
import org.springframework.stereotype.Service;

@Service
public class UserFavoriteMarketServiceImpl extends ServiceImpl<UserFavoriteMarketMapper, UserFavoriteMarket> implements UserFavoriteMarketService {

    /**
     * 用户取消收藏
     *
     * @param marketId
     * @param userId
     * @return
     */
    @Override
    public boolean deleteUserFavoriteMarket(Long marketId, Long userId) {
        return remove(new LambdaQueryWrapper<UserFavoriteMarket>()
                .eq(UserFavoriteMarket::getMarketId,marketId)
                .eq(UserFavoriteMarket::getUserId,userId));
    }
}
